Ext.define('admin.controller.basicInfoController', {
    extend: 'Ext.app.Controller',
    stores: ['deviceGroupMenuTreeStore',"cardUserStore","cardStatusStore","cardUserStatusStore","cardUserGroupMenuTreeStore"],
    models: ['deviceGroupMenuTreeModel',"cardUserModel","cardUserGroupMenuTreeModel"],
    views: ['basicInfo.cardUserAndCardView','basicInfo.cardUserMainView','basicInfo.cardUserListGridView','basicInfo.deviceMainView','basicInfo.deviceGroupMenuTree','basicInfo.linkListGridView','basicInfo.deviceListGridView','basicInfo.tempCardGridView','basicInfo.tempCardMainView','basicInfo.addCardUserMainView','basicInfo.cardUserFormView','basicInfo.cardUserGroupMenuTree'],
    control:{
        'button[action=tempCard]': {
            click: 'tempCard'
        },
        'button[action=addUserCard]': {
            click: 'addUserCard'
        },
        'button[action=deleteCard]': {
            click: 'deleteCard'
        },
        'button[action=deleteCard]': {
            click: 'deleteCard'
        },
        'button[action=editCardUser]': {
            click: 'editCardUser'
        },

    },
    tempCard:function(){
        var tempCardMainView = Ext.create('Ext.window.Window',{
            iconCls:'tempCard_16',
            title:'临时卡',
            layout:'fit',
            width:650,
            height:'80%',
            items:[{
                xtype:'basicInfo.tempCardMainView'
            }]
        });
        tempCardMainView.show();
    },
    addUserCard:function(){
        var addCardUserMainView = Ext.widget('basicInfo.addCardUserMainView');
        addCardUserMainView.iconCls = 'addUser_16';
        addCardUserMainView.title = '添加用户',
        addCardUserMainView.show();
    }
});

function cardLayoutNavigate(panel, direction){
    var layout = panel.getLayout();
    layout[direction]();
    Ext.getCmp('move-prev').setDisabled(!layout.getPrev());
    Ext.getCmp('move-next').setDisabled(!layout.getNext());
}
